package cn.iocoder.yudao.module.reservation.dal.mysql.rechargeorder;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.reservation.dal.dataobject.rechargeorder.RechargeOrderDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.reservation.controller.admin.rechargeorder.vo.*;

/**
 * 充值订单 Mapper
 *
 * @author yy
 */
@Mapper
public interface RechargeOrderMapper extends BaseMapperX<RechargeOrderDO> {

    default PageResult<RechargeOrderDO> selectPage(RechargeOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RechargeOrderDO>()
                .eqIfPresent(RechargeOrderDO::getMemberId, reqVO.getMemberId())
                .eqIfPresent(RechargeOrderDO::getActivityId, reqVO.getActivityId())
                .eqIfPresent(RechargeOrderDO::getPaymentMethod, reqVO.getPaymentMethod())
                .betweenIfPresent(RechargeOrderDO::getCompleteTime, reqVO.getCompleteTime())
                .eqIfPresent(RechargeOrderDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(RechargeOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RechargeOrderDO::getId));
    }

}